#ifndef CUBIT_H
#define CUBIT_H

#define RED		vec4(1.0, 0.0, 0.0, 1.0)
#define BLUE	vec4(0.0, 0.0, 1.0, 1.0)
#define GREEN	vec4(0.0, 1.0, 0.0, 1.0)
#define WHITE	vec4(1.0, 1.0, 1.0, 1.0)
#define YELLOW	vec4(1.0, 1.0, 0.0, 1.0)
#define ORANGE	vec4(1.0, 0.5, 0.0, 1.0)

#include "Angel\Angel.h"
#include "Shader.hpp"
#include "Globals.h"

class Cubit
{
public:
	Cubit(vec3 position, vec3 rotation = vec3(0, 0, 0), vec3 scale = vec3(1, 1, 1));
	~Cubit();

	void SetPoint(int index, float x, float y, float z);
	void SetAllPoints(int dimension);
	void SetFace(int index, int p1, int p2, int p3, int p4, vec4 color);
	void SetOrigin(vec3 origin);
	void Initialize();
	void Render();

protected:
	static const int NUM_POINTS = 8;	// 8 points in a cube
	static const int NUM_VERTS = 36;	// 6 faces, 2 triangles per face, 3 vertices per triangle

	vec4 points[8];					// 8 points (corners) of a cube
	vec4 vertices[NUM_VERTS];			// Order in which to draw each of the triangles which make up the cube
	vec4 origin;
	vec4 colors[NUM_VERTS];
	GLuint buffer;
	vec3 position, rotation, scale;

private:
	void Release();
	mat4 GetTransformation(vec3 translate, vec3 rotate, vec3 scale);

};

#endif